<?php
/**
 * Created by PhpStorm.
 * User: acker
 * Date: 21-06-08
 * Time: 下午6:25
 */

namespace App\Models\yb;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Encore\Admin\Traits\DefaultDatetimeFormat;
use Encore\Admin\Facades\Admin;



class GoodsContentModel extends Model
{
    use DefaultDatetimeFormat;

    use SoftDeletes;

    /**
     *
     *计量单位
     * @var string
     */
    protected $table = 'yb_goods_content';

    /**
     * 主键
     *
     * @var string
     */
    protected $primaryKey = 'id';



    /**
     * 该模型是否被自动维护时间戳
     *
     * @var bool
     */
    public $timestamps = true;

    /**
     * 主键
     *
     * @var string
     */
    protected $appends = ['action_id'];

    /**
     * @return mixed
     */
    public function getActionIdAttribute(){
        return $this->id;
    }

    /**
     * @return mixed
     */
    public function Goods()
    {
        return $this->hasOne(GoodsModel::class,'id','goods_id');
    }

    /**
     * @return mixed
     */
    public function User()
    {
        return $this->hasOne(UserModel::class,'id','user_id');
    }


}
